package com.zw.design.pattern.creational.structural.composite;

import java.math.BigDecimal;

public class Test {

    public static void main(String[] args) {
        CatalogComponent linux=new Course("linux课程",new BigDecimal("2"));
        CatalogComponent window=new Course("windows课程",new BigDecimal("4"));

        CatalogComponent javaAdd=new CourseCatalog("java课程目录",2);
        CatalogComponent designPattern=new Course("设计模式",new BigDecimal("66"));
        CatalogComponent spring=new Course("spring源码解析",new BigDecimal("88"));
        javaAdd.add(designPattern);
        javaAdd.add(spring);


        CatalogComponent itzhouwei=new CourseCatalog("zw课程主目录",1);
        itzhouwei.add(linux);
        itzhouwei.add(window);
        itzhouwei.add(javaAdd);
        itzhouwei.print();
    }
}
